package com.jhsw.roadsun.module.business.service.useraddress;

import com.jhsw.roadsun.framework.common.pojo.PageResult;
import com.jhsw.roadsun.module.business.controller.admin.useraddress.vo.UserAddressPageReqVO;
import com.jhsw.roadsun.module.business.controller.app.useraddress.vo.AppUserAddressPageReqVO;
import com.jhsw.roadsun.module.business.controller.app.useraddress.vo.AppUserAddressRespVO;
import com.jhsw.roadsun.module.business.controller.app.useraddress.vo.UserAddressSaveReqVO;
import com.jhsw.roadsun.module.business.dal.dataobject.useraddress.UserAddressDO;

import javax.validation.Valid;

/**
 * 地址簿 Service 接口
 *
 * @author Ysugar
 */
public interface UserAddressService {

    /**
     * 删除地址簿
     *
     * @param id 编号
     */
    void deleteUserAddress(Long id);

    /**
     * 获得地址簿
     *
     * @param id 编号
     * @return 地址簿
     */
    UserAddressDO getUserAddress(Long id);

    /**
     * 获得地址簿分页
     *
     * @param pageReqVO 分页查询
     * @return 地址簿分页
     */
    PageResult<UserAddressDO> getUserAddressPage(UserAddressPageReqVO pageReqVO);

    /**
     * 创建地址簿
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createUserAddress(@Valid UserAddressSaveReqVO createReqVO, Long userId);

    /**
     * 更新地址簿
     *
     * @param updateReqVO 更新信息
     */
    void updateUserAddress(@Valid UserAddressSaveReqVO updateReqVO, Long userId);

    void appDeleteUserAddress(Long id, Long userId);

    PageResult<AppUserAddressRespVO> appGetUserAddressPage(@Valid AppUserAddressPageReqVO pageReqVO, Long userId);

    AppUserAddressRespVO getUserNormalAddress(Integer type, Long userId);

    Long selectCountByUserId(Long userId, int type);
}